**********************************************************************************************************************************
*REPLICATION FILE
*LONG-TERM HETEROGENEITY IN IMMIGRATION NATURALISATION: THE CONDITIONAL RELEVANCE OF CIVIC INTEGRATION AND DUAL CITIZENSHIP
*
*Maarten Vink
*Anna Tegunimataka
*Floris Peters
*Pieter Bevelander
*
*03-01-2021
**********************************************************************************************************************************

*This replication file applies to all three countries of analysis (DK, NL and SE).
*For a detailed description of the data, as well as the operationalisation of all the variables, see Annex 1 of the paper.
*Under 'VARIABLES', source variables of the statistics offices that were used in its construction are provided for each country.
*Due to harmonization of data files, the same models in different countries share the same script. As such, everything under 'ANALYSES' applies to all three countries 


******
*DATA*
******

*The data files can be found at the following locations:

*[DK] Sever of Statistics Denmark Research Servers
*\\remote.dst.dk\DSTFSE\FAMC6980 

*[NL] Server of Statistics Netherlands (requires SEC1 clearance):
*\\cbsp.nl\Productie\Projecten\SAL\209253UM_FP_SEC1\Werk\Floris\MiLifeStatus\ESR_Citizenship_Acquisition

*[SE] Server of MONA remote access service of Statistics Sweden
*\\micro.intra\projekt\P1037$\P1307_Gem\ESR


*******************
*SAMPLE SELECTIONS*
*******************
* -Foreign-born individuals of whom both parents are born abroad
* -At least 18 years upon arrival in the destination country
* -Not a citizen at the moment of arrival in the destination country
* -Arrived in the destination country between 1994 and 2001
* -Track migrants annually from the third year since migration onwards


**************
*OBSERVATIONS*
**************
* -Annual observations
* -Observations years between 1997 and 2015


**********************************************************************************************************************************

***********
*VARIABLES*
***********

****************
*NATURALISATION*
****************
*[1] Naturalised
*[0] Not naturalised

*based on:
*[DK] Statsb & aar
*[NL] gbanationaliteit & jaar
*[SE] Medbland & Ar

*variable name = naturalised

**********************************************
*NATURALISATION DURING THE OBSERVATION PERIOD*
**********************************************
*[1] Naturalises during the observation period
*[0] Does not naturalise during the observation period

*based on:
*[DK] Statsb
*[NL] gbanationaliteit
*[SE] Medbland

*variable name = natioever

********
*Gender*
********
*[1] Male
*[2] Female

*based on:
*[DK] KOEN
*[NL] gbageslacht
*[SE] Kon

*variable name = gender

***********************
*Years since migration*
***********************
*based on:
*[DK] SENESTE_INDVANDRING & aar
*[NL] gbadatummigratie & jaar
*[SE] SenInvAr & Ar

*variable name = ysm

******************
*Age at migration*
******************
*[1] Age at migration 18-30
*[2] Age at migration 31-40
*[3] Age at migration 41+

*based on:
*[DK] FOED_DAG & SENESTE_INDVANDRING
*[NL] gbadatummigratie & gbageboortejaar
*[SE] SenInvAr & FodAr

*variable name = agecat

*********
*Partner*
*********
*[1] No partner
*[2] Foreign-born foreign partner
*[3] Foreign-born naturalised partner
*[4] Native partner

*based on:
*[DK] efalle & aar & Statsb & OPR_LAND
*[NL] rinpersoonp & jaar & gbanationaliteit & gbaherkomstgroepering
*[SE] P1037_LopNr_PersonNrMakPartSam & Ar & Medbland & FodelseLandNamn

*variable name = partner

*************************
*Child < 18 in household*
*************************
*[1] Child < 18 in household
*[0] No child < 18 in household

*based on:
*[DK] PNR & MOR_ID & FAR_ID & FOED_DAG
*[NL] rinpersoonpa & rinpersoonma & jaar & gbageboortejaar & huishoudnr
*[SE] P1037_Lopnr_PersonNrFar & P1037_Lopnr_PersonNrMor & Ar & FodAr & Barn

*variable name = child

****************************
*Highest level of education*
****************************
*[1] Low education
*[2] Middle education
*[3] High education
*[9] Unknown education

*based on:
*[DK] hfaudd & aar
*[NL] oplnivsoi2016agg1hb & jaar
*[SE] Sun2000Niva_old & Ar

*variable name = education

********************
*Income from labour*
********************
*[0] No employment
*[1] Lowest quartile
*[2] Second quartile
*[3] Third quartile
*[4] Highest quartile
*[9] No employment

*based on:
*[DK] PERINDKIALT_13 & LOENMV_13 & aar
*[NL] secmovactmndbedrag & secmwerkndgamndbedrag & secmzlfmndbedrag & secm & jaar
*[SE] ArbetsInk & SyssStat & Ar

*variable name = income_q

*****************************
*Dual citizenship acceptance*
*****************************
*[1] Migrant does not lose and does not have to renounce, or migrant does not lose and cannot renounce
*[0] Migrant loses citizenship or has to renounce

*based on:
*[DK] MACIMIDE Global Expatriate Dual Citizenship Database
*[NL] MACIMIDE Global Expatriate Dual Citizenship Database
*[SE] MACIMIDE Global Expatriate Dual Citizenship Database

*variable name = dualcit_ind

*****************************
*Civic integration condition*
*****************************
*[1] Civic integration condition
*[0] No civic integration condition

*based on:
*[DK] aar
*[NL] jaar
*[SE] Ar

*variable name = integration

***************
*Asylum motive*
***************
*[1] Registered asylum motive
*[0] No registered asylum motive
*[9] Unknown motive

*based on:
*[DK] grundlag
*[NL] vrlverblijfsdoel
*[SE] GFBGrupp

*variable name = asylum

*******************************************
*Year prior to civic integration condition*
*******************************************
*[1] Year prior to civic integration condition
*[0] Not year prior to civic integration condition

*based on:
*[DK] aar
*[NL] jaar
*[SE] Ar

*variable name = prior

***************************
*ORIGIN COUNTRY CATEGORIES*
***************************
*[1] Africa
*[1] Asia
*[1] South America
*[1] North America and Oceania
*[1] Europe
*[1] (former-)Yugoslavia
*[1] Poland
*[1] Turkey
*[1] Germany
*[1] Nordic

*based on:
*[DK] OPR_LAND
*[NL] gbaherkomstgroepering
*[SE] FodelseLandNamn

*variable name = esr_country_categories

****
*EU*
****
*[1] EU country of origin
*[0] No EU country of origin

*based on:
*[DK] OPR_LAND & aar
*[NL] gbaherkomstgroepering & jaar
*[SE] FodelseLandNamn & Ar

*variable name = eu

*************************
*Human development Index*
*************************
*[1] Highest HDI quintile
*[0] Not highest HDI quintile

*based on:
*[DK] Human Development Index
*[NL] Human Development Index
*[SE] Human Development Index

*variable name = hdi_dicho

*******************************************
*Proportion of votes for far-right parties*
*******************************************

*based on:
*[DK] (mean-centered) data from the European Election Database (see Annex 1)
*[NL] (mean-centered) data from the European Election Database (see Annex 1)
*[SE] (mean-centered) data from the European Election Database (see Annex 1)

*variable name = frvoting

**********************************************
*Labour market participation total population*
**********************************************

*based on:
*[DK] (mean-centered) data from Eurostat (see Annex 1)
*[NL] (mean-centered) data from Eurostat (see Annex 1)
*[SE] (mean-centered) data from Eurostat (see Annex 1)

*variable name = labour

*************************************************
*Interaction terms ysm * integration/dualcit_ind*
*************************************************

*based on:
*[DK] integration & ln(ysm) | dualcit_ind & ln(ysm)
*[NL] integration & ln(ysm) | dualcit_ind & ln(ysm)
*[SE] integration & ln(ysm) | dualcit_ind & ln(ysm)

*variable name = int_integration | int_dualcit_ind


**********************************************************************************************************************************

**********
*ANALYSES*
**********

*********************
*Cox panel structure*
*********************
stset stop, id(id_number) enter(ysm) failure(naturalised)
drop if _t == .

**************
*DESCRIPTIVES*
**************

**********
*Table A1*
**********
tabulate natioever 
tabulate gender
tabulate agecat
tabulate partner
tabulate child 
tabulate income_q
tabulate education
tabulate dualcit_ind
tabulate integration
tabulate asylum
tabulate eu
tabulate esr_country_categories 
tabulate hdi_dicho 
tabulate immigrationyear

**********
*Table A2*
**********
tabulate natioever if eu == 1
tabulate gender if eu == 1
tabulate agecat if eu == 1
tabulate partner if eu == 1
tabulate child if eu == 1
tabulate income_q if eu == 1
tabulate education if eu == 1
tabulate dualcit_ind if eu == 1
tabulate integration if eu == 1
tabulate asylum if eu == 1
tabulate eu if eu == 1
tabulate esr_country_categories if eu == 1
tabulate hdi_dicho if eu == 1
tabulate immigrationyear if eu == 1

**********
*Table A3*
**********
tabulate natioever if eu == 0
tabulate gender if eu == 0
tabulate agecat if eu == 0
tabulate partner if eu == 0
tabulate child if eu == 0
tabulate income_q if eu == 0
tabulate education if eu == 0
tabulate dualcit_ind if eu == 0
tabulate integration if eu == 0
tabulate asylum if eu == 0
tabulate eu if eu == 0
tabulate esr_country_categories if eu == 0
tabulate hdi_dicho if eu == 0
tabulate immigrationyear if eu == 0

**********
*Table A4*
**********
tabulate natioever if education == 1
tabulate gender if education == 1
tabulate agecat if education == 1
tabulate partner if education == 1
tabulate child if education == 1
tabulate income_q if education == 1
tabulate education if education == 1
tabulate dualcit_ind if education == 1
tabulate integration if education == 1
tabulate asylum if education == 1
tabulate eu if education == 1
tabulate esr_country_categories if education == 1
tabulate hdi_dicho if education == 1
tabulate immigrationyear if education == 1

**********
*Table A5*
**********
tabulate natioever if education == 2
tabulate gender if education == 2
tabulate agecat if education == 2
tabulate partner if education == 2
tabulate child if education == 2
tabulate income_q if education == 2
tabulate education if education == 2
tabulate dualcit_ind if education == 2
tabulate integration if education == 2
tabulate asylum if education == 2
tabulate eu if education == 2
tabulate esr_country_categories if education == 2
tabulate hdi_dicho if education == 2
tabulate immigrationyear if education == 2

**********
*Table A6*
**********
tabulate natioever if education == 3
tabulate gender if education == 3
tabulate agecat if education == 3
tabulate partner if education == 3
tabulate child if education == 3
tabulate income_q if education == 3
tabulate education if education == 3
tabulate dualcit_ind if education == 3
tabulate integration if education == 3
tabulate asylum if education == 3
tabulate eu if education == 3
tabulate esr_country_categories if education == 3
tabulate hdi_dicho if education == 3
tabulate immigrationyear if education == 3

***********
*Table A15*
***********
tabulate education 
tabulate education if eu == 0
tabulate education if eu == 1
tabulate education_imputed 
tabulate education_imputed if eu == 0
tabulate education_imputed if eu == 1

****************
*KAPLAIN MEIERS*
****************

**********
*Figure 2*
**********
sts list 
sts list, by(eu)

***********
*Figure A1*
***********
sts list, by(immigrationyear)


*******************
*INTERACTION PLOTS*
*******************

**********
*Figure 4*
**********
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration int_integration i.asylum frvoting labour i.eu if education == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration int_integration i.asylum frvoting labour i.eu if education == 2, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration int_integration i.asylum frvoting labour i.eu if education == 3, vce(cluster id_number) strata(esr_country_categories partner)

**********
*Figure 6*
**********
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind int_dualcit_ind i.integration i.asylum frvoting labour i.eu if eu == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind int_dualcit_ind i.integration i.asylum frvoting labour i.eu if eu == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind int_dualcit_ind i.integration i.asylum frvoting labour i.eu if hdi_dicho == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind int_dualcit_ind i.integration i.asylum frvoting labour i.eu if hdi_dicho == 0, vce(cluster id_number) strata(esr_country_categories partner)


************
*COX MODELS*
************

**********
*Table A8*
**********
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu, vce(cluster id_number) strata(esr_country_categories partner)

**********
*Table A9*
**********
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu i.esr_country_categories i.partner, vce(cluster id_number)

***********************
*Table A10 (Figure 3)*
***********************
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 2, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 3, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if eu == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if education == 1 & eu == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if education == 2 & eu == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if education == 3 & eu == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if eu == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if education == 1 & eu == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if education == 2 & eu == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if education == 3 & eu == 1, vce(cluster id_number) strata(esr_country_categories partner)

**********************
*Table A11 (Figure 5)*
**********************
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if eu == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if eu == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if hdi_dicho == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if hdi_dicho == 1, vce(cluster id_number) strata(esr_country_categories partner)

***********
*Table A12*
***********
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 2, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 3, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration_2006 i.asylum frvoting labour i.eu, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration_2006 i.asylum frvoting labour i.eu if education == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration_2006 i.asylum frvoting labour i.eu if education == 2, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration_2006 i.asylum frvoting labour i.eu if education == 3, vce(cluster id_number) strata(esr_country_categories partner)

***********
*Table A13*
***********
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if censoring == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 1 & censoring == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 2 & censoring == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 3 & censoring == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if eu == 0 & censoring == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if eu == 1 & censoring == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if hdi_dicho == 0 & censoring == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if hdi_dicho == 1 & censoring == 0, vce(cluster id_number) strata(esr_country_categories partner)

***********
*Table A14*
***********
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if eligibleyear <= year, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 1 & eligibleyear <= year, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 2 & eligibleyear <= year, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 3 & eligibleyear <= year, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if eligibleyear <= year, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if eu == 0 & eligibleyear <= year, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if eu == 1 & eligibleyear <= year, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if hdi_dicho == 0 & eligibleyear <= year, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if hdi_dicho == 1 & eligibleyear <= year, vce(cluster id_number) strata(esr_country_categories partner)

***********
*Table A16*
***********
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 2, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education == 3, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if eu == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if eu == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if hdi_dicho == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if hdi_dicho == 1, vce(cluster id_number) strata(esr_country_categories partner)

stcox i.gender i.agecat i.child i.education_imputed i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education_imputed == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education_imputed == 2, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if education_imputed == 3, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education_imputed i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education_imputed i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if eu == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education_imputed i.income_q i.dualcit_ind i.integration i.asylum frvoting labour if eu == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education_imputed i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if hdi_dicho == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education_imputed i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu if hdi_dicho == 1, vce(cluster id_number) strata(esr_country_categories partner)

***********
*Table A17*
***********
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.prior i.asylum frvoting labour i.eu, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.prior i.asylum frvoting labour i.eu if education == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.prior i.asylum frvoting labour i.eu if education == 2, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration i.prior i.asylum frvoting labour i.eu if education == 3, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.prior i.asylum frvoting labour if eu == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.prior i.asylum frvoting labour if eu == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.prior i.asylum frvoting labour i.eu if hdi_dicho == 0, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.prior i.asylum frvoting labour i.eu if hdi_dicho == 1, vce(cluster id_number) strata(esr_country_categories partner)

***********
*Table A18*
***********
stcox i.gender i.agecat i.child i.education i.income_q i.dualcit_ind i.integration i.asylum frvoting labour i.eu, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration_placebo i.asylum frvoting labour i.eu if education == 1, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration_placebo i.asylum frvoting labour i.eu if education == 2, vce(cluster id_number) strata(esr_country_categories partner)
stcox i.gender i.agecat i.child i.income_q i.dualcit_ind i.integration_placebo i.asylum frvoting labour i.eu if education == 3, vce(cluster id_number) strata(esr_country_categories partner)

